package APE.Vector_ArrayList_HashMap;

public class Test {

	/*
	 * Methodes de Test Mot
	 */

	public boolean testMotAddGet(){
	System.out.print("Test ADD et GET :");
	Mot test01 = new Mot ("toto","titi");
	if(test01.getMotFr()=="toto"&& test01.getMotEn()== "titi") {
		System.out.print(" Ok\n");
		return true;}
	System.out.print(" Ko\n");
	return false;
	
}
	public boolean testMotOrdreFr(){
	System.out.print("Test OrdreFr :");
	Mot test02 = new Mot("fr","en");
	Mot test03 = new Mot("zr","zn");
	if (test02.OrdreFancais(test03)<0) {
		System.out.print(" Ok\n");
		return true;}
	System.out.print(" Ko\n");
	return false;
}
	public boolean testMotOrdreEn(){
	System.out.print("Test OrdreEn :");
	Mot test02 = new Mot("fr","en");
	Mot test03 = new Mot("zr","zn");
	if (test02.OrdreAnglais(test03)<0) {
		System.out.print(" Ok\n");
		return true;}
	System.out.print(" Ko\n");
	return false;
}
	public boolean testMotEquals(){
	System.out.print("Test Equals :");
	Mot test02 = new Mot("fr","en");
	Mot test03 = new Mot("zr","zn");
	Mot test04 = new Mot("fr","en");
	if(! test02.equals(test03))
		if (test02.equals(test04)){
			System.out.print(" Ok\n");
			return true;}
		System.out.print(" Ko\n");
		return false;
}
	public boolean testMotToString(){
	System.out.print("Test ToString :");
	Mot test02 = new Mot("fr","en");
	if (test02.toString().equals("Fr: fr En: en")) {
		System.out.print(" Ok\n");
		return true;}
	System.out.print(" Ko\n");
	return false;
	
}
	public boolean testTotalMot(){
	System.out.println("\nTest Classe Mot");
	return(testMotAddGet() & testMotOrdreFr() & testMotOrdreEn() 
			& testMotEquals() & testMotToString());
	
}
	
	/*
	 *Methodes de Test DicoFR_EN_Arraylist 
	 */

	public boolean testDicoFR_EN_ArrayListEquals(){
	System.out.print("Test Equals :");
	DicoFR_EN_ArrayList dic0 =  new DicoFR_EN_ArrayList();
	DicoFR_EN_ArrayList dic1 =  new DicoFR_EN_ArrayList();
	
	if (dic0.equals(dic1)){
		System.out.print(" Ok\n");
		return true;}
	System.out.print(" Ko\n");
	return false;
	
}
	public boolean testDicoFR_EN_ArrayListToString(){
	System.out.print("Test ToString :");
	DicoFR_EN_ArrayList dic0 =  new DicoFR_EN_ArrayList();
	DicoFR_EN_ArrayList dic1 =  new DicoFR_EN_ArrayList();
	if (dic0.toString().equals(dic1.toString())) {
		System.out.print(" Ok\n");
		return true;}
	System.out.print(" Ko\n");
	return false;
}
	public boolean testDicoFR_EN_ArrayListTraduireToEn(){
	System.out.print("Test TraduireToEn:");
	DicoFR_EN_ArrayList dic0 =  new DicoFR_EN_ArrayList();
	if(dic0.traduireToEn("aide").equals("help")){
		System.out.print(" Ok\n");
		return true;}
	System.out.print(" Ko\n");
	return false;
}
	public boolean testDicoFR_EN_ArrayListTraduireToFr(){
	System.out.print("Test TraduireToFr:");
	DicoFR_EN_ArrayList dic0 =  new DicoFR_EN_ArrayList();
	if(dic0.traduireToFr("help").equals("aide")){
		System.out.print(" Ok\n");
		return true;}
	System.out.print(" Ko\n");
	return false;
}
	public boolean testTotalDicoFR_EN_ArrayList(){
	System.out.println("\nTest Classe DicoFR_EN_ArrayList");
	return( testDicoFR_EN_ArrayListEquals() & testDicoFR_EN_ArrayListToString()
			& testDicoFR_EN_ArrayListTraduireToEn()& testDicoFR_EN_ArrayListTraduireToFr() );
	}

	/*
	 *Methodes de Test DicoFR_EN_HashMap 
	 */
	
	public boolean testDicoFR_EN_HashMapAdd(){
		DicoFR_EN_HashMap test01 = new DicoFR_EN_HashMap();
		System.out.print("Test Add :");
		Mot motemp = new Mot("titi","toto");
		test01.add(motemp);
			if(test01.traduireToEn("titi").equals("toto")){
				System.out.print(" Ok\n");
				return true;}
			System.out.print(" Ko\n");
			return false;
			}
	public boolean testDicoFR_EN_HashMapToString(){
		System.out.print("Test ToString :");
		DicoFR_EN_HashMap dic0 =  new DicoFR_EN_HashMap();
		DicoFR_EN_HashMap dic1 =  new DicoFR_EN_HashMap();
		if (dic0.toString().equals(dic1.toString())) {
			System.out.print(" Ok\n");
			return true;}
		System.out.print(" Ko\n");
		return false;
	}
	public boolean testDicoFR_EN_HashMapTraduireToEn(){
		System.out.print("Test TraduireToEn:");
		DicoFR_EN_HashMap dic0 =  new DicoFR_EN_HashMap();
		if(dic0.traduireToEn("aide").equals("help")){
			System.out.print(" Ok\n");
			return true;}
		System.out.print(" Ko\n");
		return false;
	}
	public boolean testDicoFR_EN_HashMapTraduireToFr(){
		System.out.print("Test TraduireToFr:");
		DicoFR_EN_HashMap dic0 =  new DicoFR_EN_HashMap();
		if(dic0.traduireToFr("help").equals("aide")){
			System.out.print(" Ok\n");
			return true;}
		System.out.print(" Ko\n");
		return false;
	}
	public boolean testDicoFR_EN_HashMapEquals(){
		System.out.print("Test Equals :");
		DicoFR_EN_HashMap dic0 =  new DicoFR_EN_HashMap();
		DicoFR_EN_HashMap dic1 =  new DicoFR_EN_HashMap();
		if (dic0.equals(dic1)){
			System.out.print(" Ok\n");
			return true;}
		System.out.print(" Ko\n");
		return false;

	}
	public boolean testTotalDicoFR_EN_HashMap(){
		System.out.println("\nTest Classe DicoFR_EN_HashMap");
		return( testDicoFR_EN_HashMapEquals() & testDicoFR_EN_HashMapToString()
				& testDicoFR_EN_HashMapTraduireToEn()& testDicoFR_EN_HashMapTraduireToFr() );
		}
}